<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="top">
        Update Stock Amount
    </ui:define>

    <ui:define name="left">
    </ui:define>



    <ui:define name="body">
        <h:outputText
            style="font-weight: bold;"
            value="#{itemCTRL.item.name}"/>
        <h:form id="updateStock">
            <h:panelGrid columns="3" border="0">
                <h:outputLabel for="amount" value="Amount:"/>
                <h:inputText
                    size="3"
                    id="amount"
                    value="#{itemCTRL.item.stock}" 
                    validatorMessage="Invalid amount!">
                    <f:validateLength minimum="1" maximum="10"/>
                </h:inputText>
                <h:message for="amount"/>
                <h:commandButton
                    value="Submit"
                    action="#{itemCTRL.updateStock}"/>
            </h:panelGrid>
        </h:form>
    </ui:define>

</ui:composition>
